package com.zq.it.cms.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.zq.it.cms.common.BaseEntity;

/**
 * @author zhengqiang
 * @description 用户角色表
 */
@Entity
@Table(name = "cms_role")
public class Role extends BaseEntity{
	
	@Column(columnDefinition = "varchar(255) COMMENT '角色名称'")
	private   String   name;
	@Column(columnDefinition = "varchar(255) COMMENT '角色描述'")
	private   String   description;
	@Column(columnDefinition = "mediumtext COMMENT '功能权限'")
	private   String   perms;
	@Column(columnDefinition = "char(1) COMMENT '是否拥有所有功能权限'")
	private   boolean  allPerm;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getPerms() {
		return perms;
	}
	public void setPerms(String perms) {
		this.perms = perms;
	}
	public boolean isAllPerm() {
		return allPerm;
	}
	public void setAllPerm(boolean allPerm) {
		this.allPerm = allPerm;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Role){
			return ((Role)obj).id == this.id;
		}
		return super.equals(obj);
	}
}
